#ifndef CRECENTCALLS_H
#define CRECENTCALLS_H

#include <e32base.h>
#include <logcli.h>   // CLogClient
#include <logview.h>  // CLogViewRecent
#include <f32file.h>

enum TTask {
    EGetRecent,
    ESleep,
    EWaitingChange = 1,
    EReadingLog,
    EReadingLogItems,
    EFindingDuplicates,
    EReadingDupeItems
};

class CRecentCalls : public CActive
{

public:



    /**
     * Symbian OS default constructor
     */
    CRecentCalls();

    /**
     * 2nd phase constructor.
     */
    static CRecentCalls* NewL();

    /**
     * Destructor
     */
    ~CRecentCalls();

    /**
     * Reads recent events from the main event database
     */
    void ReadRecentEventsL();

private:
    /**
     * Symbian 2-phase constructor
     */
    void ConstructL();

    /**
     * From CActive
     */
    void RunL();

    /**
     * From CActive
     */
    TInt RunError(TInt anError);

    /**
     * From CActive
     */
    void DoCancel();

    /**
     * Handles a single recent event.
     */
    void HandleRecentEventL(const CLogEvent& anEvent);

private: // Data
    RFs iFs;

    CLogClient* iLogClient;
    CLogViewRecent* iLogViewRecent;

    TTask iTask;    // Task for RunL
};

#endif // CRECENTCALLS_H
